// #ifdef APP-PLUS
import permision from "@/js_sdk/wa-permission/permission.js"
// #endif

export async function checkAppPhotoLibrary() {
	if (uni.getSystemInfoSync().platform == "ios" && !permision.judgeIosPermission("photoLibrary")) {
		return false
	}
	if (uni.getSystemInfoSync().platform != "ios" && await permision.requestAndroidPermission(
			"android.permission.READ_EXTERNAL_STORAGE") != 1) {
		return false
	}
	return true
}


export async function checkPhotoLibrary() {
		let status  = await checkAppPhotoLibrary()
		if(!status){
			
			uni.showModal({
				content: "需要存储权限",
				confirmText: "设置",
				success: function(res) {
					if (res.confirm) {
						permision.gotoAppPermissionSetting()
					}
				}
			})
			
			return false
		}
		
		return true
}
